define(['util'], function (Util) {
    function ViewModel(params) {
        var scope = this;

        scope.pages = [];
        var storagePeriodDics = Util.ajaxGetSync({url:Util.getRestUrl('/dics'),data:{type:'保管期'}});
        var rankPeriodDics = Util.ajaxGetSync({url:Util.getRestUrl('/dics'),data:{type:'密级'}});

        for(var i=0;i<params.data.length;++i){
            scope.pages.push(params.data[i]);

            var storagePeriodDic = storagePeriodDics.data.findItemByField({name:'value',value:params.data[i].storagePeriod});
            var rankPeriodDic = rankPeriodDics.data.findItemByField({name:'value',value:params.data[i].rank});

            params.data[i]['storagePeriodT'] = storagePeriodDic?storagePeriodDic.text:'';
            params.data[i]['rankT'] = rankPeriodDic?rankPeriodDic.text:'';
        }
    }

    return ViewModel;
});
